using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Xml;
using System.Web;
using DotNetNuke;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Services.Search;

namespace PT.MuaBanXe
{
    public class MuaBanXeController
    {

        #region Constructors

        public MuaBanXeController()
        {
        }

        #endregion

        #region Public Methods

        public void DeleteCar(int ItemId)
        {
            DataProvider.Instance().DeleteCarMuaBanXe(ItemId);
        }

        public MuaBanXeInfo GetCarMuaBanXe(int ItemId)
        {
            return CBO.FillObject<MuaBanXeInfo>(DataProvider.Instance().GetCarMuaBanXe(ItemId));
        }

        public List<MuaBanXeInfo> GetCarMuaBanXeList()
        {
            return CBO.FillCollection<MuaBanXeInfo>(DataProvider.Instance().GetCarMuaBanXeList());
        }

        public void InsertUpdateCar(MuaBanXeInfo objCarList)
        {
            if (objCarList.CarName.Trim() != "")
            {
                DataProvider.Instance().InsertUpdateCarMuaBanXe(objCarList.ModuleId, objCarList.ItemId, objCarList.CarName, objCarList.CarManufacture, objCarList.CarType, objCarList.Price, objCarList.ImageURL, objCarList.OtherInfo, objCarList.Specification, objCarList.ContactInformation, objCarList.CreatedByUser);
            }
        }

        #endregion

    }
}

